package org.fast.develop.logicflow.management.builder;


import org.fast.develop.logicflow.management.service.LogicModelService;
import org.fast.develop.logicflow.repository.domain.model.LogicModel;

/**
 * @author 莫寅
 * @createTime 2022-12-20 00:54
 * @desc：
 */
public class UpdateModelBuilder {

    private String id;

    private String key;

    private String name;

    private String category;

    private LogicModelService modelManager;

    public UpdateModelBuilder(LogicModelService modelManager) {
        this.modelManager = modelManager;
    }

    public UpdateModelBuilder id(String id) {
        this.id = id;
        return this;
    }

    public UpdateModelBuilder key(String key) {
        this.key = key;
        return this;
    }

    public UpdateModelBuilder name(String name) {
        this.name = name;
        return this;
    }

    public UpdateModelBuilder category(String category) {
        this.category = category;
        return this;
    }


    public LogicModel update(){
        return modelManager.update(this);
    }

    public String getId() {
        return id;
    }

    public String getKey() {
        return key;
    }

    public String getName() {
        return name;
    }

    public String getCategory() {
        return category;
    }

}
